﻿
@{
    ViewBag.Title = "Listen";
    Layout = "~/Views/Shared/_LayoutPublic.cshtml";
    ListenMusic.Playlist_ServiceReference.Playlist playlist = ViewBag.playlist;
    List<ListenMusic.Playlist_ServiceReference.FavoritePlayList> lst = ViewBag.lstsong;
}
<script type="text/javascript" src="../../JWPlayer/jwplayer.js"></script>
<link href="../../Styles/Playlist/UserPlaylist.css" rel="stylesheet" type="text/css" />

<div id="listen-playlist">
    <div id="listen-playlist-content">
        <div>
            <table>
                <tr>
                    <td><img src="../../Images/Playlist/@playlist.Picture" alt="" width="150px" height="150px" /></td>
                    <td valign=top>
                        <table>
                            <tr>
                                 <td><strong>@playlist.PlaylistName</strong></td>
                            </tr>
                            <tr>
                             <td><strong>Ngày tạo:</strong> @playlist.DateCreate.ToShortDateString()</td>
                            </tr>
                            
                        </table>
                    </td>
                </tr>
            </table>
        </div>
        <div id="container"></div>
        <div id="list-item">
            <ul>
            @foreach (ListenMusic.Playlist_ServiceReference.FavoritePlayList x in lst)
            { 
                <li><a  href="#" onclick="jwplayer().playlistItem(@lst.IndexOf(x))">@x.SongName</a></li>
            }
            </ul>
        </div>
    </div>
</div>
<script type="text/javascript">    
        jwplayer("container").setup(
          {
          'flashplayer': '../../JWPlayer/player.swf',
          'skin' :'../../JWPlayer/Skin/lava.zip',
          'playlist.size': '0',
          'playlist.position': 'top',
          'controlbar':'top',
          'playlist': [              
           @foreach (ListenMusic.Playlist_ServiceReference.FavoritePlayList s in lst)
           {         
           @:{
           @:     'file': '../../Music/@s.SongURL',
           @:      'title': '@s.SongName',           
            @:    'width': 670,
             @:   'height': 50,
             @:   'volume': 80
            @: },
            }],
            repeat: 'list'
    });   
</script>


